from flask import Blueprint, session, redirect, url_for
bp = Blueprint('logout', __name__)

@bp.route('/logout', methods=['GET', 'POST'])
def logout():
    session.pop('username', None)
    return redirect(url_for('login.login'))